{% extends "base.html" %}
{% block header %}
<script type="text/javascript" src="/static/js/date/WdatePicker.js"></script>
<script type="text/javascript">
$(document).ready(function(){
	$("#f").hide();
	$("#search").click(function(){
		$("#f").show();
	});
	$("#shouqi").click(function(){
		$("#f").hide();
	});
});
</script>
{% endblock %}

{% block menu %}
    {% include "flow-menu.html" %}
{% endblock %}

{% block content %}
<div id="mon-tit">
        <div id="mon-tit">
            <div class="left">运维工作流 >> 操作单</div>
            <div class="right"><a href='/flow/addtask/'>发起操作单</a></div>
        </div>
</div>      
        <div class="clr"></div>
        <hr>
        <h3  class='tit'>操作单总览
            <span>
                <a href='/flow/' >待处理操作单</a> | 
                <a href='/flow/mylist'>我的操作单</a> | 
                <a href='/flow/list' style="color:black">列出所有</a> | 
                <a align="right" class="open" href="javascript:" id="search">展开</a>
                </span>
            </h3>
        <div id="f">
			<form method="post" action="/flow/search/">
				<span>操作单：&nbsp;&nbsp;&nbsp;</span><input type="text" name="fname" size="4">
				<span>&nbsp;&nbsp;产品线：&nbsp;&nbsp;</span>
					<select name="pid" >
						<option value ="">- -</option>
						{% for l in plist %}
						<option value = "{{l.id}}">-{{ l.name }}-</option>
						{% endfor %}
					</select>
				干系人：
					<select name="uid" >
					<option value ="">- -</option>
					{% for l in user %}
					<option value = "{{l.user}}">-{{ l.user }}-</option>
					{% endfor %}
					</select>&nbsp;
				<input type="submit" value="查询">&nbsp;
			    <input type="button"  value="收起" style="float:right" id="shouqi">
			</form></br>
			<form method="post" action="/flow/searcht/">
				开始时间：<input class="Wdate" name="start" type="text" onClick="WdatePicker()" size="10">&nbsp;&nbsp;
				结束时间：<input class="Wdate" name="end" type="text" onClick="WdatePicker()" size="10">&nbsp;&nbsp;
				<input type="submit"  value="查询">&nbsp;&nbsp;
			</form></br>
        </div>
            {% if flag == "open" %}
				<a href="/flow/export" style="float:right">导出搜索结果到CSV</a>
			{% endif %}
        <div  class="flow-dis right-col">
            <div class="title">
                <span style="width:5%">序号</span>
                <span style="width:20%">上线单名称</span>
                <span style="width:20%">对应模块名称</span>
                <span style="width:10%">审核人</span>
                <span style="width:10%">操作人</span>
                <span style="width:8%">状态</span>
                <span style="width:8%">操作</span>
                <span style="width:15%">发起时间</span>
            </div>
	{% if messages %}
		{% for message in messages %}
			{% if message == "null" %}
				<h3>查询失败或无结果</h3>
			{% endif %}
		{% endfor %}
	{% endif %}
          {% for l in  myList %}
            <div class="{% cycle 'ji' 'ou' %}" style='width:100%'>
                <span style="width:5%">{{ l.id}}</span>
                <span style="width:20%">{{ l.tname }}</span>
                <span style="width:20%"> {{l.pid }}</span>
                <span style="width:10%">{{ l.send_uid }}</span>
                <span style="width:10%">{{ l.op_uid }}</span>
                <span style="width:8%">{{ l.status }}</span>
                <span style="width:8%">
                           <a href="/flow/flowaction/{{ l.id }}/0/">查看</a>
                </span>
                <span style="width:15%">{{ l.timestamp|date:"Y-m-d H:i:s" }}</span>
            </div>
        {% endfor %}
        </div>

{% endblock %}

